  $(document).ready(function() {
	//自定义滚动条效果
    $("#boxscroll").niceScroll({
		cursorborder:"",
		cursorcolor:"#061535",
		boxzoom:false,
		cursoropacitymin: 1,
		cursorfixedheight: false,
		cursorborder: "1px solid #1d4263",
		cursorborderradius: "7px",
		cursorborderradius: "7px", 
		}); // First scrollable DIV
	$("#boxscroll2").niceScroll({
		cursorborder:"",
		cursorcolor:"#061535",
		boxzoom:false,
		cursoropacitymin: 1,
		cursorfixedheight: false,
		cursorborder: "1px solid #1d4263",
		cursorborderradius: "7px",
		cursorborderradius: "7px",
		}); // First scrollable DIV
		
	///弹出表单定位
	//$('.li_card_left').mouseover(function(){
	//	if($(this).find('li_card_pop').){
			
		//	}
	//	});
		
	//中间  统一认证，电子证照，政务服务  三项切换
	$('.mid_handel').mouseover(function(){
		$('#J_all_show').addClass('d-hidden');
		$('#J_zwfw').removeClass('d-hidden');
		});
	$('.mid_handel').mouseout(function(){
		$('#J_all_show').removeClass('d-hidden');
		$('#J_zwfw').addClass('d-hidden');
		});	
	
	$('.left_handel').mouseover(function(){
		$('#J_all_show').addClass('d-hidden');
		$('#J_dzzz').removeClass('d-hidden');
		});
	$('.left_handel').mouseout(function(){
		$('#J_all_show').removeClass('d-hidden');
		$('#J_dzzz').addClass('d-hidden');
		});	
	
	$('.right_handel').mouseover(function(){
		$('#J_all_show').addClass('d-hidden');
		$('#J_tyrz').removeClass('d-hidden');
		});
	$('.right_handel').mouseout(function(){
		$('#J_all_show').removeClass('d-hidden');
		$('#J_tyrz').addClass('d-hidden');
		});	
	//加载省直设备
	var provinceServer = {};
	$.ajax({
		url: contextPath + "/cloudregulation/getEquipment",
		data: {
			jsonName: "provinceServer"
		},
		type: "get",
		success: function (res) {
			provinceServer = res.data.result;
			var ht = "";
			for (var index = 0; index < provinceServer.length; index++){
				ht += htmlAdd(provinceServer[index],index);
			}
			$("#province_box_card_list").html(ht);
		}
	});
	//加载市州设备
	var cityServer = {}
	$.ajax({
		url: contextPath + "/cloudregulation/getEquipment",
		data: {
			jsonName: "cityServer"
		},
		type: "get",
		success: function (res) {
			cityServer = res.data.result;
			var cityht = "";
			for (var index = 0; index < cityServer.length; index++){
				cityht += htmlAdd(cityServer[index],index);
			}
			$("#city_box_card_list").html(cityht);
		}
	});
	
	function htmlAdd(result,index){
		var html = "<li class='clearfix'>";
		if((index+1)%3 == 0){
			html += "<div class='li_card_left modr'>";
		}else{
			html += "<div class='li_card_left'>";
		}
		if(result.provideType == 0){
			if(result.state == "正常"){
				html += "<img src='../js/images/screen/cloudregulation/yjg_computer_icon.png' width='95' height='76'>";
			}else{
				html += "<img src='../js/images/screen/cloudregulation/yjg_computer_icon0.png' width='95' height='76'>";
			}
		}else{
			if(result.state == "正常"){
				html += "<img src='../js/images/screen/cloudregulation/yjg_computer_icon3.png' width='95' height='76'>";
			}else{
				html += "<img src='../js/images/screen/cloudregulation/yjg_computer_icon2.png' width='95' height='76'>";
			}
		}
		html += "<span class='msg_num'>"+result.msgNum+"+</span>";
		html += "<div class='li_card_pop'>";
		html += "<table width='100%' border='0' class='li_card_child'>";
		html += "<tr>";
		html += "<td width='65' align='right'>节点名称</td>";
		html += "<td colspan='3'><strong class='pop_tl'>"+result.cmpanyName +"-"+ result.model+"</strong></td>";
		html += "</tr>";
		html += "<tr>";
		html += "<td width='65' align='right'>IP</td>";
		html += "<td width='150'><p class='area_text'>"+result.ip+"</p></td>";
        html += "<td width='55' align='right'>CPU</td>";
        html += "<td><p class='area_text green'><span class='p_lf'><i style='width:"+result.cpu+"'></i></span><span class='p_rt'>"+result.cpu+"</span></p></td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td width='65' align='right'>链接状态</td>";
        html += "<td><p class='area_text'>"+result.state+"</p></td>";
        html += "<td width='55' align='right'>内存</td>";
        html += "<td><p class='area_text green'><span class='p_lf'><i style='width:"+result.memory+"'></i></span><span class='p_rt'>"+result.memory+"</span></p></td>";
        html += "</tr>";
        html += "<tr>";
        html += "<td width='65' align='right'>报警</td>";
        html += "<td><p class='area_text'>"+result.callPolice+"</p></td>";
        html += "<td width='55' align='right'>硬盘</td>";
        html += "<td><p class='area_text green'><span class='p_lf'><i style='width:"+result.hardDisk+"'></i></span><span class='p_rt'>"+result.hardDisk+"</span></p></td>";
        html += "</tr>";
        html += "</table>";
        html += "</div>";
        html += "</div>";
        html += "<div class='li_card_right'>";
        html += "<h4>"+result.cmpanyName +"</h4>";
        html += "<p><span class='lip_lf1'>CPU</span><span class='lip_lf2'><i style='width:"+result.cpu+"'></i></span><span class='lip_lf3'>"+result.cpu+"</span></p>";
        html += "<p><span class='lip_lf1'>内存</span><span class='lip_lf2'><i style='width:"+result.memory+"'></i></span><span class='lip_lf3'>"+result.memory+"</span></p>";
        html += "<p><span class='lip_lf1'>硬盘</span><span class='lip_lf2'><i style='width:"+result.hardDisk+"'></i></span><span class='lip_lf3'>"+result.hardDisk+"</span></p>";
        html += "</div>";
        html += "</li>";
        return html;
	}
	
	//加载省直情况（中间图）
	var provinceSituation = {}
	$.ajax({
		url: contextPath + "/cloudregulation/getEquipment",
		data: {
			jsonName: "provinceSituation"
		},
		type: "get",
		success: function (res) {
			provinceSituation = res.data;
			var allUnmHtml = allUnm(provinceSituation.zwgx,provinceSituation.dzzz,provinceSituation.tyrz);
			$("#J_all_show").html(allUnmHtml);
			var zwgxHtml = zwgx(provinceSituation.zwgx);
			$("#J_zwfw").html(zwgxHtml);
			var dzzzHtml = dzzz(provinceSituation.dzzz);
			$("#J_dzzz").html(dzzzHtml);
			var tyrzHtml = tyrz(provinceSituation.tyrz);
			$("#J_tyrz").html(tyrzHtml);
		}
	});
	
	//省直中间图总数据
	function allUnm(zwgx,dzzz,tyrz){
		var html = "";
		html += "<div class='sever_big_mid'></div>";
		html += "<span class='fw_num'><i>"+(zwgx.serverNum+dzzz.serverNum+tyrz.serverNum)+"</i>台</span>";
        html += "<span class='cp_num'><i>"+(zwgx.hardDiskStorageNum+dzzz.hardDiskStorageNum+tyrz.hardDiskStorageNum)+"</i>T</span>";
        html += "<span class='nc_num'><i>"+(zwgx.memoryNum+dzzz.memoryNum+tyrz.memoryNum)+"</i>G</span>";
        html += "<span class='cpsyl_num'><i>"+(zwgx.hardDiskUsageRate+dzzz.hardDiskUsageRate+tyrz.hardDiskUsageRate)+"</i>%</span>";
        html += "<span class='wl_num'><i>"+(zwgx.network+dzzz.network+tyrz.network)+"</i>M/S</span>";
        html += "<span class='bj_num'><i>"+(zwgx.callPoliceNum+dzzz.callPoliceNum+tyrz.callPoliceNum)+"</i>次</span>";
        return html;
	}
	
	//省直中间政务共享
	function zwgx(zwgx){
		var html = "";
		html += "<div class='sever_big_mid hover_mid'></div>";
		html += "<span class='fw_num'><i>"+zwgx.serverNum+"</i>台</span>";
		html += "<span class='cp_num'><i>"+zwgx.hardDiskStorageNum+"</i>T</span>";
        html += "<span class='nc_num'><i>"+zwgx.memoryNum+"</i>G</span>";
        html += "<span class='cpsyl_num'><i>"+zwgx.hardDiskUsageRate+"</i>%</span>";
        html += "<span class='wl_num'><i>"+zwgx.network+"</i>M/S</span>";
        html += "<span class='bj_num'><i>"+zwgx.callPoliceNum+"</i>次</span>";
        return html;
	}
	
	//省直中间电子证照
	function dzzz(dzzz){
		var html = "";
		html += "<div class='sever_big_mid hover_lf'></div>";
		html += "<span class='fw_num'><i>"+dzzz.serverNum+"</i>台</span>"; 
        html += "<span class='cp_num'><i>"+dzzz.hardDiskStorageNum+"</i>T</span>";
        html += "<span class='nc_num'><i>"+dzzz.memoryNum+"</i>G</span>";
        html += "<span class='cpsyl_num'><i>"+dzzz.hardDiskUsageRate+"</i>%</span>";
        html += "<span class='wl_num'><i>"+dzzz.network+"</i>M/S</span>";
        html += "<span class='bj_num'><i>"+dzzz.callPoliceNum+"</i>次</span>";
        return html;
	}
	
	//省直中间统一认证
	function tyrz(tyrz){
		var html = "";
		html += "<div class='sever_big_mid hover_rt'></div>";
		html += "<span class='fw_num'><i>"+tyrz.serverNum+"</i>台</span>";
		html += "<span class='cp_num'><i>"+tyrz.hardDiskStorageNum+"</i>T</span>";
		html += "<span class='nc_num'><i>"+tyrz.memoryNum+"</i>G</span>";
		html += "<span class='cpsyl_num'><i>"+tyrz.hardDiskUsageRate+"</i>%</span>";
		html += "<span class='wl_num'><i>"+tyrz.network+"</i>M/S</span>";
		html += "<span class='bj_num'><i>"+tyrz.callPoliceNum+"</i>次</span>";
        return html;
	}
  });